package com.advertise.testing;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.web.context.support.XmlWebApplicationContext;

public class TestMail {
	public static void main(String args[]){
	
		
		ClassPathXmlApplicationContext ctx=new ClassPathXmlApplicationContext("commonBeans.xml");
		
		
		MailSender sender=(MailSender)ctx.getBean("mailSender");
		
		SimpleMailMessage smm=new SimpleMailMessage();
		
		smm.setTo("testjavamail.aaa82@gmail.com");
		
		smm.setFrom("testjavamail.aaa82@gmail.com");
		
		smm.setSubject("test subject");
		
		smm.setText("this is a test mail");
		
		sender.send(smm);
	}
}
